package br.furb.jpa.dao;

import java.util.ArrayList;

import br.furb.jpa.persistence.GenericPersistence;
import br.furb.jpa.persistence.GenericPersistenceException;
import br.furb.jpa.persistence.OrderType;
import br.furb.models.Midia;

public class MidiaDAO extends GenericPersistence<Midia> implements
		DAOObject<Midia> {

	public MidiaDAO(String puName) {
		super(puName);
	}

	@Override
	public ArrayList<Midia> search(OrderType orderType)
			throws GenericPersistenceException {
		ArrayList<Midia> returnList;
		Object[] parameters = {};
		if (orderType == OrderType.Asc)
			returnList = this.executeNamedQuery("Midia.searchAsc", parameters);
		else
			returnList = this.executeNamedQuery("Midia.searchDesc", parameters);

		return returnList;
	}

	@Override
	public Boolean isUsed(Midia entity) throws GenericPersistenceException {

		return false;
	}

}
